package com.HW.Search;

import java.sql.SQLOutput;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

/**
 * @ClassName : TArrayMinNum
 * @Author : kele
 * @Date: 2023/11/5 14:11
 * @Description :
 */
public class TArrayMinNum {

    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        String[] str = sc.nextLine().split(" ");
        handle(str);

    }

    public static void handle(String[] str) {

        Arrays.sort(str, (o1, o2) -> (o1 + o2).compareTo(o2 + o1));


        if (str[0].startsWith("0")) {
            for (int i = 1; i < str.length; i++) {
                if (!str[i].startsWith("0")) {
                    str[0] = str[i] + str[0];
                    str[i] = "";
                    break;
                }
            }
        }
        String res = "";
        for (String s : str) {
            res += s;
        }

        res = "".equals(res) ? "0" : res;

        System.out.println(res);

    }
}
